package com.cnc.bas.web;


import com.cnc.bas.util.Constants;
import com.cnc.ssm.ISsmService;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;


/**
 * @author Du bf
 * @version 1.0  2005-3-29
 */

public final class LogoffAction extends BasAction {

    public ActionForward execute(ActionMapping mapping,
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {
        HttpSession session = request.getSession();
        
//        Long loginId = new Long(String.valueOf(session.getAttribute(Constants.LOGIN_ID)));
//        ISsmService ssmService = (ISsmService) this.getBean(Constants.BEAN_NAME_SSM);
//       
//        ssmService.updateLoginInfo(loginId);
//        session.removeAttribute(Constants.USER_KEY);
//        session.removeAttribute("userName");
        session.invalidate();
        return (mapping.findForward("logon"));
    }
}
